package com.seckillpro.seckill_pro.utils;

import org.thymeleaf.util.StringUtils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @Package: com.SecKillpro.SecKill_pro.utils
 * @ClassName: ValidatorUtil
 * @Author: lyx
 * @CreateTime: 2021/3/3 15:04
 * @Description:
 */
public class ValidatorUtil {

    private static final Pattern mobile_pattern = Pattern.compile("[1]([3-9])[0-9]{9}$");

    public static boolean isMobile(String mobile) {
        if (StringUtils.isEmpty(mobile)) {
            return false;
        }
        Matcher matcher = mobile_pattern.matcher(mobile);
        return matcher.matches();
    }
}
